<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page language="java" import="com.jxLC.Action.*"%>
<%@ page language="java" import="com.jxLC.Model.*" %>
<%@ page language="java" import="com.jxLC.Service.*" %>
<%@ page language="java" import="java.io.File" %>
<%@page import="java.text.SimpleDateFormat"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>:::江西低碳合作交流网:::</title>
	<link href="/mycss/my.css"  rel="stylesheet" type="text/css" />
	<style type="text/css">
	.createdate{
		font-size: 12px;
		float:right;
		height:25px; 
	    line-height:25px; 
	    overflow:hidden; 
	}
	.topic {
		float: left;
		font-size: 14px;
	}
	
	*{margin:0;padding:0;border:0;list-style:none;}
		body{padding:20px;background:#eee;}
		#myfocus{width:306px;height:315px;overflow:hidden;padding:6px 3px 3px 3px;background:#333 url(/my.photo/photo/2010626103358712.jpg) no-repeat;position:relative;}
		#myfocus #myloading{position:absolute;top:0;left:0;z-index:9999;width:300px;height:315px;background:#333;color:#f60;font-size:12px;text-align:center;padding-top:90px;}
		#myfocus #myloading .bg{position:absolute;top:0;left:0;z-index:-1;}/*载入画面*/
		#myfocus .pics{width:300px;height:315px;overflow:hidden;position:relative;}
		#myfocus .pics ul{height:315px;position:absolute;}
		#myfocus .pics ul li{width:300px;height:315px;float:left;position:relative;}/*图片大小450px*296px*/
		#myfocus .pics ul li div,#myfocus .pics ul li div span,#myfocus .pics ul li div a{display:block;position:absolute;bottom:0;left:0;width:100%;height:34px;}
		#myfocus .pics ul li div span{filter:alpha(opacity=50);opacity: 0.5;background:#000;}/*文字标题的背景样式*/
		#myfocus .pics ul li div a{line-height:34px;overflow:hidden;padding-left:16px;text-decoration:none;font-size:14px;color:#fff;font-weight:bold;}/*文字标题样式*/
		#myfocus .mybtn{position:absolute;bottom:8px;right:8px;}
		#myfocus .mybtn ul li{float:left;width:16px;height:6px;margin-left:4px;overflow:hidden;border:1px solid #000;background:#ccc;cursor:pointer;}
		#myfocus .mybtn ul li.current{background:#f60;}
	</style>
	<script type="text/javascript" src="/myjs/jquery.js"></script>
	<script type="text/javascript" src="/myjs/link.js"></script>
    <script type="text/javascript" src="/myjs/my.js"></script>
    <script type="text/javascript" src="/myjs/lunbo.js"></script>
    <script type="text/javascript">
  

       var result ="<%=request.getAttribute("errorMessage")%>";
        var result2 ="<%=request.getAttribute("addsuccess")%>";                                     
     
     if(result2!='null'  &&  result2!=undefined)
     {
           alert(result2);
     }   
     
   		function checkForm(myform) {				
				if(myform.Cnum.value == "") {
					alert('用户账号必须输入！');
					myform.Cnum.focus();
					return false;
				}
				if(myform.CPasswd.value == "") {
					alert('密码必须输入！');
					myform.CPasswd.focus();
					return false;
				}
				return true;	
			}


   		/*design by koen @ 10nian5yue11ri*/
   		/*http://hi.baidu.com/koen_li*/
   		function setFocus(ID,t){//主函数...
   		function $(id) {return document.getElementById(id);}
   		function $$(tag,obj){return (typeof obj=='object'?obj:$(obj)).getElementsByTagName(tag);}
   		var n='';//标记
   		function showPics(num){
   		 if(n===num) return true;
   		 if(n==='') n=0;
   		 else n=num;
   		 var pics=$$('ul',ID)[0];
   		 var tit=$$('div',pics)[num];
   		 if (!pics.style.left){pics.style.left = 0+'px';}
   		    if (!tit.style.bottom||parseInt(tit.style.bottom)>-34){tit.style.bottom = -34+'px';}
   		 var endX=-num*$$('div',ID)[0].clientWidth;
   		 var goimg=function(){
   		  X=parseInt(pics.style.left);
   		  if (pics.movement){clearTimeout(pics.movement);}
   		  if(parseInt(pics.style.left)==endX) return true;
   		  if((endX-X)>0) X+=Math.ceil((endX-X) / 10);
   		  else X+=Math.floor((endX-X) / 10);
   		  pics.style.left=X+'px';
   		  pics.movement = setTimeout(goimg, 5);
   		 }
   		 var gotit=function(){
   		  var y=parseInt(tit.style.bottom);
   		  if (tit.movement){clearTimeout(tit.movement);}
   		  if(y==0) return true;
   		  y+=Math.ceil((0-y) / 10);
   		  if(parseInt(pics.style.left)==endX) tit.style.bottom=y+'px';
   		  if(y<0) tit.movement = setTimeout(gotit, 16);
   		 }
   		 goimg();
   		 gotit();
   		}
   		function classNormal() {//数字标签样式清除
   		    var focusBtnList = $$('li',$$('ul',ID)[1]);
   		    for (var i = 0; i < focusBtnList.length; i++) {
   		        focusBtnList[i].className = '';
   		    }
   		}
   		function focusChange() {//交互切换
   		    var focusBtnList = $$('li',$$('ul',ID)[1]);
   		    for (var i = 0; i < focusBtnList.length; i++) {
   		  focusBtnList[i].I=i;
   		  focusBtnList[i].onmouseover = function(){
   		         showPics(this.I);
   		         classNormal();
   		         focusBtnList[this.I].className = 'current';
   		  }
   		 }
   		}
   		var autoFocusChange=function() {//自动运行
   		    if (atuokey) return;
   		    var focusBtnList = $$('li',$$('ul',ID)[1]);
   		    for (var i = 0; i < focusBtnList.length; i++) {
   		        if (focusBtnList[i].className == 'current') {
   		            var currentNum = i;
   		        }
   		    }
   		 if(currentNum<focusBtnList.length-1){
   		  showPics(currentNum+1);
   		        classNormal();
   		        focusBtnList[currentNum+1].className = 'current';
   		 }else if(currentNum==focusBtnList.length-1){
   		  showPics(0);
   		        classNormal();
   		        focusBtnList[0].className = 'current';
   		 }
   		}
   		var atuokey = '';
   		function init(){//初始化<div><span></span><a href="#">文字说明</a></div>
   		 var ul=$$('ul',ID)[0];
   		 var li=$$('li',ul);
   		 var NUM=li.length;
   		 var wid=$('myloading')?$$('div',ID)[1].clientWidth:$$('div',ID)[0].clientWidth;ul.style.width=wid*NUM+'px';
   		 for(var i=0;i<NUM;i++){
   		  var a=li[i].getElementsByTagName('a')[0];
   		  var img=li[i].getElementsByTagName('img')[0];
   		  li[i].innerHTML=li[i].innerHTML+'<div><span></span><a href="'+a+'">'+img.alt+'</a></div>';
   		 }
   		 var s='<div class="mybtn"><ul>';
   		 for(var i=0;i<NUM;i++){s+='<li></li>'}
   		 s+='</ul></div>';
   		 $(ID).innerHTML+=s;
   		 $(ID).removeChild($('myloading'));
   		 showPics(0);
   		    classNormal();
   		    $$('li',$$('ul',ID)[1])[0].className = 'current';
   		 $(ID).onmouseover = function() {
   		        atuokey = true;
   		  clearInterval(auto);
   		    }
   		    $(ID).onmouseout = function() {
   		        atuokey = false;
   		  auto=setInterval(autoFocusChange, T);
   		    }
   		}
   		var T=t*1000;//每帧图片停留的时间，1000=1秒
   		var auto='';
   		init();
   		focusChange();
   		auto=setInterval(autoFocusChange, T);
   		};
   		window.onload=function(){
   		 setFocus('myfocus',4);
   		}
	</script>	
  </head>
  
 <body  style="background-color:#EBFCF3" >
 
  <div id="all">
    <s:include value="/admin/header.jsp"></s:include>
  </div>
  <center>
  	<div id="middle">
	    <div id="mL">
		    <div id="mL1">
		    	<div id="mL1a">
			    	<div id="myfocus"><!--只需定义这个ID即可-->
			    		<div id="myloading">请稍候...<br /><br />
			   				<img alt="" src="/my.photo/photo/2010626103358861.gif" />
			    			<img class="bg" alt="" src="/my.photo/photo/2010626103358712.jpg" />
			    		</div><!--载入画面，可以不要-->
			    		<div class="pics">
			    			<ul>
			   				 <%
			    				 List<IndexPic> indexpiclist = (List)request.getAttribute("indexpiclist"); 
			    				 for(int i = 0;i< indexpiclist.size();i++){
			    				 IndexPic indexpic = indexpiclist.get(i);
			    			 %>
				    		 <li><a href="<%=indexpic.getPiclink() %>" target="_blank"><img alt="<%=indexpic.getInfo()%>" src="<%=indexpic.getPicSrc() %>" width="290" height="305"/></a></li>
			    			 <%}%>
				 			</ul>
				 		</div>
				 	</div>
			    </div>
				<div id="mL1b">
				    <div id="mL1b1"><span style="float:left;"><img src="/my.photo/photo/logo/icons/arrow_branch.png" />新 闻</span>   
				    	<span style="float:right;"><a  href="/Detail/news.jsp" target="_balnk">更多...</a></span> 
				    </div>
					 <div id="mL1b2">
					 <ul id="u1">
					 <%
					 Map<Integer, List<Content>> contentmap=(Map<Integer, List<Content>>)request.getAttribute("contentmap");
					 List<Content> contents = contentmap.get(1);
					 int i=0;
		              for(Content content : contents){
			                %>
			                  <li>
			                  <div class="topic" style="float:left;">
			                  	<img src="my.photo/photo/logo5.jpg">&nbsp;<a href="getContenttextAction.action?CContent_ID=<%=content.getCContent_ID() %>&source=index" target="_blank"><%=content.getCContent_topic()%></a>
			                  <% 
			                  if("Y".equals(content.getCnewtarget())){ %><img alt="" src="/my.photo/photo/new.gif">  <% } %>
			                  </div>
			                  <div class="createdate" style="float:right;"><%=content.getCContent_time() %></div>
			                  </li>
			                <%
			                i++;
			                if(i==6) break;
		                  }
					  %>
					 </ul>
					</div>
				</div>
			</div>
			<div id="mL2">
			    <div id="mL2a">
				    <div id="mL2a1"><span style="float:left;"><img src="my.photo/photo/logo/icons/world_go.png" />  展会动态</span>
				    	<span style="float:right;"><a href="Detail/exhibition.jsp" target="_balnk">更多...</a></span>
				    </div>
					<div id="mL2a2">
					    <ul id="u1">
					    <%i=0;
					    	contents=contentmap.get(2);
					    	for(Content content:contents){
					    		%>
					     <li><div class="topic" style="float:left;">
					     <img src="my.photo/photo/logo6.jpg">&nbsp;<a href="getContenttextAction.action?CContent_ID=<%=content.getCContent_ID() %>" target="_blank"><%=content.getCContent_topic() %></a>
					    		</div><div class="createdate" style="float:right;"><%=content.getCContent_time() %></div>
					    </li><%
			                i++;
			                if(i==6) break;
					    	}
					     %></ul>
					</div>
				</div>
				<div id="mL2b">
				    <div id="mL2b1"><span style="float:left;"><img src="my.photo/photo/logo/icons/arrow_divide.png" />  前沿技术</span>
				     	<span style="float:right;"><a href="Detail/technology.jsp" target="_balnk">更多...</a></span>
				     </div>
					<div id="mL2b2">
					    <ul id="u1">
					    <%i=0;
					    	contents=contentmap.get(3);
					    	for(Content content:contents){
					    		
					    		%>
					     <li><div class="topic" style="float:left;"><img src="my.photo/photo/logo6.jpg">&nbsp;<a href="getContenttextAction.action?CContent_ID=<%=content.getCContent_ID() %>" target="_blank"><%=content.getCContent_topic() %></a>
					     </div><div class="createdate" style="float:right;"><%=content.getCContent_time() %></div>
					     </li>
					    		<%
			                i++;
			                if(i==6) break;
					    	}
					     %>
					    </ul>
					</div>
				</div>
			</div>
            <div id="mL3">
			    <div id="mL3a">
				    <div id="mL3a1"><span style="float:left;"><img src="my.photo/photo/logo/icons/brick_go.png" />  江西低碳 </span>
				    <span style="float:right;"><a href="Detail/jxtc.jsp" target="_balnk">更多...</a></span>
				    </div>
					<div id="mL3a2">
					    <ul id="u1">
					    <%i=0;
					    	contents=contentmap.get(4);
					    	for(Content content:contents){
					    		
					    		%>
					     <li><div class="topic" style="float:left;"><img src="my.photo/photo/logo6.jpg">&nbsp;<a href="getContenttextAction.action?CContent_ID=<%=content.getCContent_ID() %>" target="_blank"><%=content.getCContent_topic() %></a>
					     </div><div class="createdate" style="float:right;"><%=content.getCContent_time() %></div></li>
					    		<%
			                i++;
			                if(i==6) break;
					    	}
					     %>
					     </ul>  
					</div>
				</div>
				<div id="mL3b">
				    <div id="mL3b1"><span style="float:left;"><img src="my.photo/photo/logo/icons/arrow_inout.png" />  科普知识 </span>
				    <span style="float:right;"><a href="Detail/science.jsp" target="_balnk">更多...</a></span>
				    </div>
					<div id="mL3b2">
					    <ul id="u1">
					    <%i=0;
					    	contents=contentmap.get(5);
					    	for(Content content:contents){
					    		
					    		%>
					     <li><div class="topic" style="float:left;"><img src="my.photo/photo/logo6.jpg">&nbsp;<a href="getContenttextAction.action?CContent_ID=<%=content.getCContent_ID() %>" target="_blank"><%=content.getCContent_topic() %></a>
					     </div><div class="createdate" style="float:right;"><%=content.getCContent_time() %></div></li>
					    		<%
			                i++;
			                if(i==6) break;
					    	}
					     %>
					    </ul>   
					</div>
				</div>
			</div>
			<div id="mL4">
			    <div id="mL4a"><h4 align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" class="a1">战略合作伙伴</a> | <a href="#" class="a2">友情链接</a></h4></div>
				<div id="mL4b" style="float:left;">
				<s:iterator var="link1" value="lk1">
				               <a href="${link1.link }" target="_blank">${link1.lname }</a>
				</s:iterator>
				</div>
				<div id="mL4c" style="float:left;display: none">
					<s:iterator var="link2" value="lk2">
					               <a href="${link2.link }" target="_blank">${link2.lname }</a>
					</s:iterator>
				</div>
			</div>
		</div>
		<div id="mM"></div>
		<div id="mR">
		    <div id="mR1">
			    <div id="mR1a">
			       <form action="Detail/searchresult.jsp"  >
			             <img  src="my.photo/photo/logo/icons/zoom_in.png" />  
			             全站搜索:&nbsp;<input size="15" type="text" name="title" value="关键词" onmouseover="this.focus()" onfocus="this.select()" style="border: 1px solid green;width:10px； padding-top:6px;"/> 
				         <input type="submit" style="height:28px;width:50px;" value="检索" /> 
				   </form>
				</div>
				<div id="mR1b"><h4 align="left">&nbsp;&nbsp;<img src="my.photo/photo/logo/icons/user_add.png" />  项目信息平台</h4></div>
				<% 
				User user=(User)session.getAttribute("us"); 
				if(user == null){
				%>
				<div id="mR1c">
				    <div id="mf">
				   <form action="Login!login" method="post" onsubmit="return checkForm(this);">
				       <p style="margin-top:40px;font-weight:bold;">
				                          用户名：<input type="text" name="Cnum" style="border: 1px solid #00FF99 ;padding-top:3px; height:25px;width:140px; " /></p>
					    <p style="margin-top:10px;font-weight:bold;"> 密&nbsp; &nbsp;&nbsp;码：<input type="password" name="CPasswd" style="border: 1px solid #00FF99;padding-top:3px;width:140px; height:25px;" /></p>
					     <p style="margin-top:10px;"><input type="submit" value="登 录" style="width:80px;height:30px;font-size:16px;font-family:'新宋体'; font-weight:bold;"  />&nbsp;&nbsp;
					     <input type="button" value="注册" style="width:80px;height:30px;font-size:16px;font-family:'新宋体'; font-weight:bold;" onclick="Do()" /></p>
					<script type="text/javascript">
					function Do(){
					window.open("/zhuce.jsp ");
					}
					</script>
				   </form>
				    </div>
				</div>
				<%
				}else {
				%>
				<div id="mR1c">
				    <div id="mff">
				        <div id="mff1">欢迎您！<font color="blue" size="4px"><%=user.getCnum()%></font> 您已成功登录！</div>
				        <div id="mff2"><a href="contentAction?action=logout">[点此退出个人登录]</a></div>
				        <div id="mff3"><a href="user/check.jsp?Cnum=<%=user.getCnum() %>" target="_blank">进入用户主页</a></div>
				    </div>
				</div>
				<%
				}
				%>
			</div> 
			<div id="mR2">
			    <div id="mR2a"><span style="float:left;"><img src="my.photo/photo/logo/icons/application_view_columns.png" />  项目信息  </span>
			    	<span style="float:right;"><a href="Detail/iinfo.jsp" target="_balnk">更多...</a></span>
			    </div>
				<div id="mR2b">
				     <ul id="u1">
				     <%i=0;
					 Map<Integer, List<Filecontent>> fcontentmap=(Map<Integer, List<Filecontent>>)request.getAttribute("fcontentmap");
					 List<Filecontent> fcontents = fcontentmap.get(1);
		              for(Filecontent fcontent : fcontents){
			                %>
			                  <li><div class="topic" style="float:left;">
			                  <img src="my.photo/photo/logo6.jpg">&nbsp;<a href="getFContenttextAction.action?CFC_id=<%=fcontent.getCFC_id() %>" target="_blank"><%=fcontent.getCFC_topic()%></a>
			                  </div><div class="createdate" style="float:right;"><%=fcontent.getCFC_time()%></div></li>
			                <%
			                i++;
			                if(i==6) break;
		                  }
					  %>
					     </ul>   
				</div>
			</div>

			<div id="mR3"></div>
		</div>
	</div>  
	</center>
	<s:include value="/admin/tail.jsp"></s:include>
</body>
</html>

